<?php
/**
 * @version $Id: view.html.php 22 2011-09-20 10:52:20Z truongnhan0311 $
 */
 
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.application.component.view' );

class WrdViewConfig extends WrdView{
	
	function display($tpl = null) {
		$user  = &JFactory::getUser();
		if(!$user->authorise('wrd.dashboard.config', 'com_wrd'))
			return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
		
		$fnc = 'display'.ucfirst($this->getLayout());
		if (is_callable(array(&$this, $fnc)))
			$this->$fnc($tpl);
		else
			parent::display($tpl);
	}

	function displayDefault($tpl = null){
	    $user = &JFactory::getUser();
		$document = & JFactory::getDocument();
		$document->setTitle( JText::_('Config') );

		JToolBarHelper::title(JText::_('Config Board'),'activity.png');
		
		if($user->authorise('wrd.dashboard.admin', 'com_wrd'))
			JToolBarHelper::preferences('com_wrd','wrdconfig', '600');
		
		WrdHelper::addSubMenu('config',$view);
		$this->sidebar = JHtmlSidebar::render();
		
		$this->assignRef('user', $user);
	    parent::display($tpl);
  	}
}
?>